/*
package com.lzy.config;

import com.lzy.global.user_info.CurrentThreadLoginUserInfo;
import com.lzy.token.TokenParser;
import com.lzy.token.manage.TokenManageService;
import com.lzy.util.ThreadLocalUtil;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.util.StringUtils;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.HashMap;
import java.util.Map;

*/
/**
 * 认证
 *//*

@Component
@Slf4j
public class AuthorizationTokenParser extends TokenParser {
    @Autowired
    private TokenManageService tokenManageService;

    @Override
    public Object parserToken(HttpServletRequest request) {
        Map<String, Object> userInfo = new HashMap<>(8);
        Long tenantId = this.getTenantIdByRequest(request);
        if (tenantId != null) {
            userInfo.put(CurrentThreadLoginUserInfo.USER_LOGIN_THREAD_KEY_TENANT, tenantId);
        }
        String token = getTokenByRequest(request);
        if (StringUtils.isEmpty(token)) {
            ThreadLocalUtil.setObject(userInfo);
            return null;
        }
        userInfo.put(CurrentThreadLoginUserInfo.USER_LOGIN_THREAD_KEY_TOKEN, token);
        Object details = tokenManageService.getTokenUserDetails(token);
        setMap(details, userInfo, tenantId);
        ThreadLocalUtil.setObject(userInfo);
        return details;
    }

    @Override
    public boolean authorization(HttpServletRequest request, HttpServletResponse response) {
        return true;
    }

    private void setMap(Object authInfo, Map<String, Object> userInfo, Long tenantId) {
        if (authInfo == null) {
            return;
        }
        // TODO 之后再写后台用户登录时候的逻辑
        */
/*if (authInfo instanceof AdminAuthInfo) {
            AdminAuthInfo info = (AdminAuthInfo) authInfo;
            TenantUserDTO infoMember = info.findMember(tenantId);
            if (infoMember == null) {
                return;
            }
            userInfo.put(UserLoginThread.USER_LOGIN_THREAD_KEY_USER_ID, info.getId());
            userInfo.put(UserLoginThread.USER_LOGIN_THREAD_KEY_USER_NAME, infoMember.getMemberName());
            return;
        }*//*



    }
}


*/
